﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Aij1.Utils;
using System.Text.RegularExpressions;

namespace Aij1
{
    public class WebPagerSEO : WebPager
    {
        protected override string PageNumFormat
        {
            get { return "<a href='{0}_p{1}.htm'>{2}</a>"; }
        }

        protected override string RemovePageParam()
        {
            string pageName = base.RemovePageParam();
            pageName = Regex.Replace(pageName, @"^(.+).aspx(\?Id=(\d+))?[&|\?]?$", "$1_$3");
            if (pageName.EndsWith("_")) pageName = pageName.Remove(pageName.Length - 1);
            return pageName;
        }
    }
}